<?php
/**
 * Factory to create an ArrayValueConverter.
 * 
 * @author  Frank Kleine <frank.kleine@schlund.de>
 */
XJConfLoader::load('converters.factories.ValueConverterFactory',
                   'converters.ArrayValueConverter'
);
/**
 * Factory to create an ArrayValueConverter.
 * 
 * @package     XJConf
 * @subpackage  converters
 */
class ArrayValueConverterFactory implements ValueConverterFactory
{
    /**
     * Decides whether the ArrayValueConverter is responsible for the given Definition.
     *
     * @param   Definition  $def
     * @return  boolean     true if is responsible, else false
     */
    public function isResponsible(Definition $def)
    {
        return ($def->getType() == 'array');
    }
    
    /**
     * creates an instance of the ArrayValueConverter
     *
     * @param   Definition          $def
     * @return  ArrayValueConverter
     */
    public function createValueConverter(Definition $def)
    {
        $converter = new ArrayValueConverter();
        return $converter;
    }
}
?>